package com.lry.jvm.instructions.comparisons;

import com.lry.jvm.instructions.base.BranchInstruction;
import com.lry.jvm.instructions.base.NoOperandsInstruction;
import com.lry.jvm.rtda.Frame;
import com.lry.jvm.rtda.OperandStack;

public class if_acmpne extends BranchInstruction {
    @Override
    public byte getOpCode() {
        return (byte) 0xa6;
    }

    @Override
    public void execute(Frame frame) throws Exception {
        OperandStack operandStack = frame.getOperandStack();
        Object v2 = operandStack.popRef();
        Object v1 = operandStack.popRef();
        if (!v2.equals(v1)) {
            branch(frame,offset);
        }
    }
}
